#include <stdint.h>

typedef struct reentrant_lock {
    volatile uint32_t owner;
    volatile uint32_t count;
} reentrant_lock_t;

void reentrant_acquire(reentrant_lock_t *lk);
void reentrant_release(reentrant_lock_t *lk);